﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Word;
using System.Reflection;
using System.Runtime.InteropServices;

namespace OfficeApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            //OfficeApplication.Program app = new Program();
            Microsoft.Office.Interop.Word._Application app = new Microsoft.Office.Interop.Word.Application();
            Microsoft.Office.Interop.Word._Document doc = null;

            object missing = Missing.Value;
            object readOnly = false;
            object isVisible = true;
            Object filename = @"C:\Users\Дима\Desktop\RFI.Система обработки и маршрутизации транзакций платежных сервисов.docx";
            /*
            doc = app.Documents.Open(ref filename,
                                         ref missing,
                                         ref readOnly,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref isVisible,
                                         ref missing,
                                         ref missing,
                                         ref missing,
                                         ref missing);*/
            app.Visible = true;
            app.ShowMe();
            if (doc != null)
            {
                doc.Close(ref missing, ref missing, ref missing);
                Marshal.ReleaseComObject(doc);
                doc = null;
            }
            //Marshal.ReleaseComObject(app);
            
        }
    }
}
